From: Wei Liu Date: Fri, 20 Mar 2015 16:19:10 +0000 (+0000) Subject: libxl: remove device model path in libxl__device_model_destroy X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~3534 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=e2155b6b0c0cc16f4fa85cc52ef58f7a4f6af5ec;p=xen.git libxl: remove device model path in libxl__device_model_destroy ... and not devices_destroy_cb because it is the right place to clean up device model stuff. And the path should use LIBXL_TOOLSTACK_DOMID instead of hardcoded 0. Signed-off-by: Wei Liu Acked-by: Ian Campbell --- diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 46de4f7bd3..e9b4ed3191 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -1663,8 +1663,6 @@ static void devices_destroy_cb(libxl__egc *egc, LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "xs_rm failed for %s", dom_path); xs_rm(ctx->xsh, XBT_NULL, libxl__xs_libxl_path(gc, domid)); - xs_rm(ctx->xsh, XBT_NULL, libxl__sprintf(gc, - "/local/domain/0/device-model/%d", domid)); xs_rm(ctx->xsh, XBT_NULL, libxl__sprintf(gc, "/local/domain/%d/hvmloader", domid)); diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index e8fe73d833..5b8c3c0673 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -1650,6 +1650,11 @@ out: int libxl__destroy_device_model(libxl__gc *gc, uint32_t domid) { + char *path = libxl__device_model_xs_path(gc, LIBXL_TOOLSTACK_DOMID, + domid, ""); + if (!xs_rm(CTX->xsh, XBT_NULL, path)) + LOG(ERROR, "xs_rm failed for %s", path); + /* We should try to destroy the device model anyway. */ return kill_device_model(gc, GCSPRINTF("/local/domain/%d/image/device-model-pid", domid)); }